Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(completion): added more mappings for copilot-lua-cmp #150

Merged
merged 2 commits into from
Apr 28, 2023

Conversation

Cthutu
Copy link
Contributor

@Cthutu Cthutu commented Apr 16, 2023

It is very useful to accept Co-pilot suggestions one word at a time or even a whole line. Copilot offers these features but they have not been exposed. VS Code, by default uses Ctrl+Right to accept a word. I've added similar vim-like controls:

  • Ctrl+Right/L for accepting a word
  • Ctrl+Down/J for accepting a line
  • Ctrl+C to dismiss the suggestion

It is very useful to accept Co-pilot suggestions one word at a time or even a whole line.  Copilot offers these features but they have not been exposed.  VS Code, by default uses Ctrl+Right to accept a word.  I've added similar vim-like controls:

* Ctrl+Right/L for accepting a word
* Ctrl+Down/J for accepting a line
* Ctrl+C to dismiss the suggestion
@luxus
Copy link
Member

luxus commented Apr 18, 2023

as many people using copilot i waiting for some comments, i don't use this version i use the normal version because i like the cmp and tab

@sjcobb2022
Copy link
Contributor

I mean this is more of a preference thing no? Wouldn't it just be better to put this in the user defined opts instead?

@Cthutu
Copy link
Contributor Author

Cthutu commented Apr 19, 2023

I disagree. The ability to use copilot's complete next word and complete line is vital to partially accepting its suggestions and makes the tool more productive. The pack adds ctrl-x/z which I would argue is less useful in practice, so why not add the more important features.

This, of course, is a judgement call.

@luxus
Copy link
Member

luxus commented Apr 22, 2023

everyone can add their own preferences. the main reason for this config is that the tab thing is working.
not sure if adding extra keybinding is important.. imho they are optional (i don't use the word or line thing at all, and i use copilot a lot)
so i still hope some people that actually using this variant of copilot can give some input,
if we would mimic vscode this would make more sense for me

@luxus luxus changed the title feat: added mappings for Copilot completion pack feat: added more mappings for copilot-lua-cmp Apr 22, 2023
@mehalter mehalter changed the title feat: added more mappings for copilot-lua-cmp feat(completion): added more mappings for copilot-lua-cmp Apr 26, 2023
Copy link
Member

@mehalter mehalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure formatting and linting is passing

@justyn
Copy link

justyn commented Apr 28, 2023

imho they are optional (i don't use the word or line thing at all, and i use copilot a lot) so i still hope some people that actually using this variant of copilot can give some input, if we would mimic vscode this would make more sense for me

I use the copilot accept_line option a lot, and should probably use accept_word more too.

But I just set them in my own keymap.

Copy link
Member

@mehalter mehalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the formatting/linting. LGTM

@mehalter mehalter merged commit 872b1e5 into AstroNvim:main Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants